DROP TABLE IF EXISTS jms_ods.tab_bagbillcode ;
CREATE EXTERNAL TABLE jms_ods.tab_bagbillcode (
BAGCODE            string        comment  '包编号' ,                     --NVARCHAR2(20)
BILLCODE            string        comment  '运单单号' ,                     --NVARCHAR2(20)
SUBBILLCODE            string        comment  '子单号' ,                     --NVARCHAR2(20)
PCS            bigint        comment  '件数' ,                     --NUMBER
WEIGHT            double        comment  '重量' ,                     --NUMBER(9,2)
SCANTIME            timestamp        comment  '扫描时间' ,                     --DATE
INPUTTIME            timestamp        comment  '录入时间' ,                     --DATE
SCANUSER            string        comment  '扫描雇员' ,                     --NVARCHAR2(30)
SCANUSERCODE            string        comment  '扫描雇员编号' ,                     --NVARCHAR2(20)
INPUTSITE            string        comment  '录入部门' ,                     --NVARCHAR2(30)
SCANSITECODE            string        comment  '扫描网点编号'                     --NVARCHAR2(20)
)
    COMMENT '袋运单子单表'
    PARTITIONED BY (dt STRING COMMENT '更新日期 (yyyy-MM-dd)')
    STORED AS PARQUET
    LOCATION '/dw/hive/jms_ods.db/external/tab_bagbillcode'
    TBLPROPERTIES (
        'discover.partitions' = 'false',
        'parquet.column.index.access' = 'true'
        );

MSCK REPAIR TABLE jms_ods.tab_bagbillcode;
